|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
PER.rover.control.ReceiveThread
Contains the thread class for receiving and parsing information returned by the rover during color tracking, mean color detection, and motion detection as well as pictures taken during turnTo and driveTo commands. Also contains public variables and methods for accessing this data
Field Summary | |
int |
maxX
When tracking, this is the maximum x-coordinate where the object was detected |
int |
maxY
When tracking, this is the maximum y-coordinate where the object was detected |
static int |
MEAN_RECEIVE
use this variable in the [un]registerObject functions to be notified of new mean color data |
int |
meanU
Updated by getMean, this is the average U value. |
int |
meanV
Updated by getMean, this is the average V value. |
int |
meanY
Updated by getMean, this is the average Y value. |
int |
minX
When tracking, this is the minimum x-coordinate where the object was detected |
int |
minY
When tracking, this is the minimum y-coordinate where the object was detected |
int[] |
motion
This array stores the difference in intensity between frames. |
static int |
MOTION_RECEIVE
use this variable in the [un]registerObject functions to be notified of new motion data |
static int |
PICTURE_RECEIVE
use this variable in the [un]registerObject functions to be notified of new pictures |
int |
pixels
When tracking, this is the total number of pixels tracked |
static int |
TRACK_RECEIVE
use this variable in the [un]registerObject functions to be notified of new tracking data |
int |
x
When tracking, this is the mean x-coordinate where the object was detected |
int |
y
When tracking, this is the mean y-coordinate where the object was detected |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
ReceiveThread(Reliagram reliagram,
RoverState State)
Creates a new instance of ReceiveThread |
Method Summary | |
long |
getImageUpdateTime()
Lets you know when the last image came back from the rover. |
long |
getMeanUpdateTime()
Lets you know when the last packet containing mean color data came back from the rover. |
long |
getMotionUpdateTime()
Lets you know when the last packet containing motion data came back from the rover. |
java.awt.image.BufferedImage |
getRecentImage()
Gets the most recent image taken on the stargate. |
long |
getTrackUpdateTime()
Lets you know when the last packet containing tracking data came back from the rover. |
void |
quit()
Do not call this function. |
boolean |
registerObject(java.lang.Object o,
int type)
Registers an object to be notified when new data arrives that you are interested in. |
void |
run()
|
boolean |
unregisterObject(java.lang.Object o,
int type)
Unregisters an object that was registered with the registerObject() function. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PICTURE_RECEIVE
public static final int TRACK_RECEIVE
public static final int MEAN_RECEIVE
public static final int MOTION_RECEIVE
public int minX
public int minY
public int maxX
public int maxY
public int x
public int y
public int pixels
public int meanY
public int meanU
public int meanV
public int[] motion
getMotionUpdateTime()
to see when it was last updated.
Constructor Detail |
public ReceiveThread(Reliagram reliagram, RoverState State)
Method Detail |
public void run()
public void quit()
public java.awt.image.BufferedImage getRecentImage()
public long getImageUpdateTime()
public long getTrackUpdateTime()
public long getMeanUpdateTime()
public long getMotionUpdateTime()
public boolean registerObject(java.lang.Object o, int type)
notify()
will be called. See
PER.rover.DetectMotionAction for an example of this function used.
Make sure to call unregisterObject when you are done. This will free up the resources associated with notifying.
o
- The object to be registered.type
- The type of data you want to be notified for. See the *_RECEIVE
constants from this class: PICTURE_RECEIVE, TRACK_RECEIVE, MEAN_RECEIVE,
and MOTION_RECEIVE.
public boolean unregisterObject(java.lang.Object o, int type)
o
- The object to be unregistered.type
- The type of data you want to be notified for. See the *_RECEIVE
constants from this class: PICTURE_RECEIVE, TRACK_RECEIVE, MEAN_RECEIVE,
and MOTION_RECEIVE.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |